﻿package view.mainUI.mainBottom.controller
{
    import com.core.*;
    import com.greensock.*;
    import com.sh.game.display.*;
    import com.sh.game.util.*;
    import flash.display.*;
    import flash.events.*;
    import flash.filters.*;
    import flash.geom.*;
    import flash.utils.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import view.mainUI.mainBottom.ui.*;
    import view.uilt.*;

    public class MenuControl extends Object
    {
        private var mUI:MainBottom;
        private var _emailMovieId:uint = 0;
        private var _openUIMovieId:uint = 0;
        private var _jiaoyiMovieId:uint = 0;
        private var _lastOnHorse:int = 0;
        public var guajiIng:Boolean = false;
        private var _glowFilter:GlowFilter;
        private var _petState:int = 0;
        private var openLevel:Object;
        private var _YiTianMc:XMLMovieClip;
        private var _loadYitian:Boolean = false;
        private var mIsLow:Boolean = false;
        private var timelineDic:Dictionary;
        private var time:uint = 0;
        private var flag:Boolean;
        private var neigongObj:Object;
        private var exp:Number = 0;
        private var timeline3:TweenMax;
        private var vipmc:XMLMovieClip;
        private var _shenlugonfig:Object;
        private var yycountArr:Array;
        private var Message:Object;
        private var max:int;
        private var lv:int;

        public function MenuControl(param1:MainBottom)
        {
            this._glowFilter = new GlowFilter(MColor.New6, 1, 10, 10, 2);
            this.openLevel = ConfigDictionary.data.openlevel;
            this.timelineDic = new Dictionary();
            this._shenlugonfig = ConfigDictionary.data.shenlu;
            this.yycountArr = [];
            this.mUI = param1;
            return;
        }// end function

        private function initListener() : void
        {
            var btn:Component;
            var addListener:* = function (param1:Component, param2:Boolean = true) : void
            {
                param1.addEventListener(MouseEvent.CLICK, clickHandler);
                param1.addEventListener(MouseEvent.ROLL_OVER, rollover);
                param1.addEventListener(MouseEvent.ROLL_OUT, rollout);
                return;
            }// end function
            ;
            this.mUI._bloodTop.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
            this.mUI._bloodTop.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
            this.mUI.expTop.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
            this.mUI.expTop.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
            var arr:Array;
            var _loc_2:int = 0;
            var _loc_3:* = arr;
            while (_loc_3 in _loc_2)
            {
                
                btn = _loc_3[_loc_2];
                this.addListener(btn);
            }
            this.addListener(this.mUI.expProgress, false);
            this.mUI.changebtn.addEventListener(MouseEvent.CLICK, this.changejinjianHandler);
            return;
        }// end function

        protected function changejinjianHandler(event:MouseEvent) : void
        {
            UIVisibleManager.instance.Hiddern();
            return;
        }// end function

        public function setPos(event:Event = null) : void
        {
            var e:* = event;
            this.mUI.callLater(function () : void
            {
                var _loc_1:* = new Point(0, 0);
                UIGlobel.pointsDic["vip"] = mUI.vip.localToGlobal(_loc_1);
                UIGlobel.pointsDic["store"] = mUI.store.localToGlobal(_loc_1);
                UIGlobel.pointsDic["social"] = mUI.friend.localToGlobal(_loc_1);
                UIGlobel.pointsDic["role"] = mUI.role.localToGlobal(_loc_1);
                UIGlobel.pointsDic["bag"] = mUI.bag.localToGlobal(_loc_1);
                UIGlobel.pointsDic["qianghua"] = mUI.qianghua.localToGlobal(_loc_1);
                UIGlobel.pointsDic["skill"] = mUI.skill.localToGlobal(_loc_1);
                UIGlobel.pointsDic["team"] = mUI.team.localToGlobal(_loc_1);
                UIGlobel.pointsDic["union"] = mUI.union.localToGlobal(_loc_1);
                UIGlobel.pointsDic["wing"] = mUI.wing.localToGlobal(_loc_1);
                UIGlobel.pointsDic["shenlu"] = mUI.shenlu.localToGlobal(_loc_1);
                UIGlobel.pointsDic["friend"] = mUI.friend.localToGlobal(_loc_1);
                UIGlobel.pointsDic["guanwei"] = mUI.guanwei.localToGlobal(_loc_1);
                UIGlobel.pointsDic["guajibtn"] = mUI.guajibtn.localToGlobal(_loc_1);
                UIGlobel.pointsDic["petstate"] = mUI.petstate.localToGlobal(_loc_1);
                return;
            }// end function
            );
            return;
        }// end function

        private function doAutoTeamHandler(event:MouseEvent) : void
        {
            ModelProxy.change("mainui", "autoteam", null);
            return;
        }// end function

        private function doBigSkillHandler(event:MouseEvent) : void
        {
            if (this.mUI.angerValue < 300)
            {
                ModelProxy.change("movetips", "error", "怒气值未满");
            }
            else
            {
                ModelProxy.change("zone", "doBigSkill", null);
            }
            return;
        }// end function

        public function checkOpenLevel(param1:String, param2:int = 0) : Boolean
        {
            var _loc_4:Object = null;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_3:* = ConfigDictionary.data.openlevel;
            if (_loc_3[param1] && _loc_3[param1][param2])
            {
                _loc_4 = _loc_3[param1][param2];
                _loc_5 = UserData.getUserData("level");
                _loc_6 = UserData.getUserData("rein");
                if (_loc_6 > _loc_4.rein)
                {
                    return false;
                }
                if (_loc_6 == _loc_4.rein)
                {
                    if (_loc_5 >= _loc_4.level)
                    {
                        return false;
                    }
                    WarningManager.show(38, [_loc_4.level]);
                    return true;
                }
                else
                {
                    WarningManager.show(39, [_loc_4.rein]);
                    return true;
                }
            }
            return false;
        }// end function

        protected function clickHandler(event:MouseEvent) : void
        {
            var _loc_4:Object = null;
            var _loc_2:* = event.currentTarget.name;
            var _loc_3:* = event.currentTarget.localToGlobal(new Point(0, 0));
            var _loc_5:* = UserData.getUserData("level");
            var _loc_6:Point = null;
            switch(_loc_2)
            {
                case "role":
                {
                    break;
                }
                case "guanwei":
                {
                    break;
                }
                case "bag":
                {
                    break;
                }
                case "qianghua":
                {
                    break;
                }
                case "skill":
                {
                    break;
                }
                case "store":
                {
                    break;
                }
                case "team":
                {
                    break;
                }
                case "union":
                {
                    break;
                }
                case "wing":
                {
                    break;
                }
                case "horse":
                {
                    _loc_2 = "role";
                    _loc_4 = 5;
                    break;
                }
                case "compound":
                {
                    break;
                }
                case "social":
                {
                    break;
                }
                case "rank":
                {
                    if (this.checkOpenLevel("rank"))
                    {
                        return;
                    }
                    break;
                }
                case "achievement":
                {
                    break;
                }
                case "vip":
                {
                    this.stopVip();
                    break;
                }
                case "email":
                {
                    ModelProxy.change("mainview", "hidemail", null);
                }
                case "petstate":
                {
                    this.petStateSelect();
                    return;
                }
                case "downhorse":
                {
                    this.onOffHorse();
                    return;
                }
                case "onhorse":
                {
                    this.onOffHorse();
                    return;
                }
                case "guaji":
                {
                    this.hookingHandler();
                    return;
                }
                case "yitian":
                {
                    ModelProxy.change("zone", "doYitianSkill", null);
                    break;
                }
                case "tosmall":
                {
                    break;
                }
                case "tolarge":
                {
                    break;
                }
                case "systemset":
                {
                    _loc_4 = 3;
                    break;
                }
                case "dig":
                {
                    ModelProxy.change("zone", "autodig", null);
                    return;
                }
                default:
                {
                    break;
                }
            }
            if (_loc_4)
            {
                ModelProxy.change("plugin", "change", {target:_loc_2, point:_loc_3, data:_loc_4, top:_loc_6});
            }
            else
            {
                ModelProxy.change("plugin", "change", {target:_loc_2, point:_loc_3, top:_loc_6});
            }
            return;
        }// end function

        public function showPetBtn(param1:Boolean) : void
        {
            this.mUI.petstate.visible = false;
            return;
        }// end function

        private function showVip() : String
        {
            var _loc_1:String = null;
            var _loc_3:int = 0;
            var _loc_4:Number = NaN;
            var _loc_5:Number = NaN;
            var _loc_6:int = 0;
            var _loc_2:* = UserData.getOnlineData();
            if (_loc_2)
            {
                _loc_3 = _loc_2.vip;
                _loc_4 = _loc_2.viptime;
                _loc_5 = ModelProxy.getValue("data", "servertime") + Number(getTimer());
                _loc_6 = (_loc_4 - _loc_5) / 1000 / 3600 / 24;
                if (!_loc_3 || _loc_3 == 0)
                {
                    _loc_1 = "您当前还不是VIP\n";
                }
                else if (_loc_3 == -1)
                {
                    _loc_1 = "体验VIP";
                }
                else
                {
                    switch(_loc_3)
                    {
                        case 1:
                        {
                            _loc_1 = "白银VIP";
                            break;
                        }
                        case 2:
                        {
                            _loc_1 = "黄金VIP";
                            break;
                        }
                        case 3:
                        {
                            _loc_1 = "至尊VIP";
                            break;
                        }
                        default:
                        {
                            break;
                            break;
                        }
                    }
                    _loc_1 = "您当前为" + _loc_1 + "，剩余天数：" + _loc_6;
                }
            }
            return _loc_1;
        }// end function

        public function showDig(param1:Boolean) : void
        {
            this.mUI.dig.visible = param1;
            return;
        }// end function

        private function hookingHandler() : void
        {
            if (!this.guajiIng)
            {
                WarningManager.show(85);
                ModelProxy.change("zone", "startGuaji", null);
            }
            else
            {
                WarningManager.show(86);
                ModelProxy.change("zone", "stopGuaji", null);
            }
            return;
        }// end function

        private function petStateSelect() : void
        {
            if (this._petState == 0)
            {
                ModelProxy.change("zone", "changePetState", 1);
            }
            else if (this._petState == 1)
            {
                ModelProxy.change("zone", "changePetState", 2);
            }
            else if (this._petState == 2)
            {
                ModelProxy.change("zone", "changePetState", 3);
            }
            else
            {
                ModelProxy.change("zone", "changePetState", 0);
            }
            return;
        }// end function

        protected function rollout(event:MouseEvent) : void
        {
            ModelProxy.change("tips", "state", "close");
            return;
        }// end function

        protected function rollover(event:Event) : void
        {
            var _loc_2:String = null;
            var _loc_4:Object = null;
            var _loc_5:int = 0;
            var _loc_3:int = 69;
            switch(event.currentTarget)
            {
                case this.mUI._bloodTop:
                {
                    if (this.mUI.rbobj)
                    {
                        _loc_2 = MColor.getHMTL("生命:" + this.mUI.rbobj.hp + " / " + this.mUI.rbobj.maxHp, 52) + "\n" + MColor.getHMTL("法力:" + this.mUI.rbobj.mp + " / " + this.mUI.rbobj.maxMp, _loc_3) + "\n可以使用药品恢复损失的生命值和魔法值";
                    }
                    break;
                }
                case this.mUI.role:
                {
                    _loc_2 = MColor.getHMTL("角色（快捷键C）", _loc_3) + "\n角色信息，包括属性、装备、技能等";
                    break;
                }
                case this.mUI.bag:
                {
                    _loc_2 = MColor.getHMTL("背包（快捷键B）", _loc_3) + "\n可以存放游戏中获得的道具、装备";
                    break;
                }
                case this.mUI.qianghua:
                {
                    _loc_2 = MColor.getHMTL("铸造（快捷键J）", _loc_3) + "\n可以进行装备的强化、转移、镶嵌、转生";
                    break;
                }
                case this.mUI.skill:
                {
                    _loc_2 = MColor.getHMTL("技能（快捷键S）", _loc_3);
                    break;
                }
                case this.mUI.store:
                {
                    _loc_2 = MColor.getHMTL("商城（快捷键V）", _loc_3) + "\n可以使用元宝和礼券购买道具";
                    break;
                }
                case this.mUI.team:
                {
                    _loc_2 = MColor.getHMTL("组队（快捷键P）", _loc_3) + "\n可以查看你的组队信息";
                    break;
                }
                case this.mUI.union:
                {
                    _loc_2 = MColor.getHMTL("行会（快捷键U）", _loc_3) + "\n查看行会的信息和行会的福利";
                    break;
                }
                case this.mUI.wing:
                {
                    _loc_2 = MColor.getHMTL("羽翼（快捷键N）", _loc_3) + "\n光翼激活升级可获得更酷外形，更多属性";
                    break;
                }
                case this.mUI.shenlu:
                {
                    _loc_2 = MColor.getHMTL("神炉（快捷键G）", _loc_3) + "\n锻造特殊部位装备";
                    break;
                }
                case this.mUI.friend:
                {
                    _loc_2 = MColor.getHMTL("好友（快捷键F）", _loc_3) + "\n可以查看好友的信息";
                    break;
                }
                case this.mUI.expProgress:
                case this.mUI.expTop:
                {
                    _loc_4 = UserData.getUserData();
                    if (_loc_4)
                    {
                        _loc_5 = ConfigDictionary.data.level[UserData.getUserData("level")];
                        _loc_2 = "经验:" + _loc_4.exp + "/" + _loc_5 + "(" + int(100 * _loc_4.exp / _loc_5) + "%)";
                    }
                    break;
                }
                case this.mUI.petstate:
                {
                    if (this._petState == 0)
                    {
                        _loc_2 = MColor.getHMTL("切换宝宝状态（快捷键Ctrl + A）", _loc_3) + "\n保护模式：神兽只有在主人受到攻击，或者自己受到攻击才会展开反击；另外神兽会攻击主人攻击的目标";
                    }
                    else if (this._petState == 1)
                    {
                        _loc_2 = MColor.getHMTL("切换宝宝状态（快捷键Ctrl + A）", _loc_3) + "\n攻击模式：神兽会攻击视野内所有可攻击单位";
                    }
                    else if (this._petState == 2)
                    {
                        _loc_2 = MColor.getHMTL("切换宝宝状态（快捷键Ctrl + A）", _loc_3) + "\n跟随模式：神兽只会跟随主人，不会展开任何攻击";
                    }
                    else
                    {
                        _loc_2 = MColor.getHMTL("切换宝宝状态（快捷键Ctrl + A）", _loc_3) + "\n休息模式：神兽原地停留，不会产生任何行为";
                    }
                    break;
                }
                case this.mUI.btnSet:
                {
                    _loc_2 = MColor.getHMTL("设置（快捷键O）", _loc_3) + "\n可以进行系统设置和挂机设置";
                    break;
                }
                case this.mUI.guajibtn:
                {
                    _loc_2 = MColor.getHMTL("挂机（快捷键Z）", _loc_3) + "\n一键快速挂机";
                    break;
                }
                case this.mUI.downHorseBtn:
                {
                    _loc_2 = MColor.getHMTL("骑乘（快捷键X）", _loc_3) + "\n下马";
                    break;
                }
                case this.mUI.onHorseBtn:
                {
                    _loc_2 = MColor.getHMTL("骑乘（快捷键X）", _loc_3) + "\n上马";
                    break;
                }
                case this.mUI.guanwei:
                {
                    _loc_2 = MColor.getHMTL("官职系统（快捷键 I）", _loc_3) + "\n点击打开官职系统";
                    break;
                }
                default:
                {
                    break;
                }
            }
            if (_loc_2)
            {
                ModelProxy.change("tips", "normal", {data:_loc_2, p:new Point()});
            }
            return;
        }// end function

        public function init() : void
        {
            this.initListener();
            UIVisibleManager.instance.register("mainui", this.mUI.groupBtn, "down");
            this.mUI.dig.visible = false;
            return;
        }// end function

        public function showZuoqi(param1:Boolean) : void
        {
            this.mUI.onHorseBtn.visible = !param1;
            this.mUI.downHorseBtn.visible = param1;
            return;
        }// end function

        public function showZuoqiBtn(param1:Boolean) : void
        {
            var _loc_2:* = ModelProxy.getValue("mainview", "hideZuoqiBtn");
            if (_loc_2 == 1)
            {
                this.mUI.onHorseBtn.visible = false;
                this.mUI.downHorseBtn.visible = false;
                return;
            }
            this.mUI.onHorseBtn.visible = param1;
            if (param1 == false)
            {
                this.mUI.downHorseBtn.visible = false;
            }
            return;
        }// end function

        public function setPetState(param1:int) : void
        {
            this._petState = param1;
            var _loc_2:String = "png.mainbottom.pet_bh";
            switch(param1)
            {
                case 0:
                {
                    _loc_2 = "png.mainbottom.pet_bh";
                    break;
                }
                case 1:
                {
                    _loc_2 = "png.mainbottom.pet_gj";
                    break;
                }
                case 2:
                {
                    _loc_2 = "png.mainbottom.pet_gs";
                    break;
                }
                case 3:
                {
                    _loc_2 = "png.mainbottom.pet_xx";
                    break;
                }
                default:
                {
                    break;
                }
            }
            this.mUI.petstate.bitmapData = App.asset.getBitmapData(_loc_2);
            return;
        }// end function

        private function clearJiaoyiMc() : void
        {
            if (this._jiaoyiMovieId > 0)
            {
                clearInterval(this._jiaoyiMovieId);
            }
            this._jiaoyiMovieId = 0;
            return;
        }// end function

        public function setBagCount(param1:int) : void
        {
            var _loc_2:* = ModelProxy.getValue("data", "option.showgncount") == 1 ? (true) : (false);
            if (_loc_2 == true)
            {
                if (param1 == 0)
                {
                    this.mUI.bagcount.visible = true;
                    this.mUI.bagCountBg.url = "png.common.team_count";
                    this.mUI.bagCountLabel.text = "满";
                }
                else if (param1 > 5)
                {
                    this.mUI.bagCountLabel.text = "";
                    this.mUI.bagcount.visible = false;
                }
                else if (this.mUI.bagcount)
                {
                    this.mUI.bagcount.visible = true;
                    this.mUI.bagCountBg.url = "png.common.team_gth";
                    this.mUI.bagCountLabel.text = "";
                }
            }
            else
            {
                this.mUI.bagCountLabel.text = "";
                this.mUI.bagcount.visible = false;
            }
            return;
        }// end function

        public function updateAcm() : void
        {
            return;
        }// end function

        public function btnNumChange() : void
        {
            var _loc_1:* = ModelProxy.getValue("data", "bag");
            if (_loc_1 == null)
            {
                return;
            }
            this.setBagCount(_loc_1.emptycount);
            return;
        }// end function

        public function autoteamVisible(param1:Boolean) : void
        {
            return;
        }// end function

        public function onOffHorse() : void
        {
            if (this._lastOnHorse > getTimer())
            {
                return;
            }
            this._lastOnHorse = getTimer() + 1000;
            ModelProxy.change("zone", "onHorse", 0);
            return;
        }// end function

        public function low(param1:Boolean) : void
        {
            this.mIsLow = param1;
            this.mUI.y = this.mUI.y + (this.mIsLow ? (20) : (-20));
            return;
        }// end function

        public function get isLow() : Boolean
        {
            return this.mIsLow;
        }// end function

        public function doShake(param1:String) : void
        {
            return;
        }// end function

        public function showZudui(param1:Object) : void
        {
            this.mUI.zhudui.visible = true;
            if (this.time > 0)
            {
                clearInterval(this.time);
                this.time = 0;
            }
            this.mUI.zhudui.alpha = 1;
            this.flag = true;
            this.time = setInterval(this.reAlpha, 100);
            this.mUI.zhudui.clickHandler = new Handler(this.openTeam, [param1]);
            return;
        }// end function

        private function reAlpha() : void
        {
            if (this.flag)
            {
                this.mUI.zhudui.alpha = this.mUI.zhudui.alpha - 0.1;
                if (this.mUI.zhudui.alpha <= 0.2)
                {
                    this.flag = false;
                }
            }
            else
            {
                this.mUI.zhudui.alpha = this.mUI.zhudui.alpha + 0.1;
                if (this.mUI.zhudui.alpha >= 1)
                {
                    this.flag = true;
                }
            }
            return;
        }// end function

        protected function openTeam(param1:Object) : void
        {
            this.mUI.zhudui.visible = false;
            if (this.time > 0)
            {
                clearInterval(this.time);
                this.time = 0;
            }
            return;
        }// end function

        private function animateComp(param1:Button) : void
        {
            if (this.timelineDic[param1])
            {
                delete this.timelineDic[param1];
            }
            param1.filters = [];
            return;
        }// end function

        public function showGuanWeiCount() : void
        {
            var _loc_6:Object = null;
            var _loc_1:* = ModelProxy.getValue("data", "user");
            if (_loc_1.level < this.openLevel["guanwei"][0].level)
            {
                return;
            }
            var _loc_2:* = ModelProxy.getValue("data", "bag.shengwang");
            var _loc_3:* = ConfigDictionary.data.guanwei;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            while (_loc_5 < 27)
            {
                
                if (_loc_5 > _loc_1.guanzhi && _loc_2 >= _loc_3[_loc_5].count && _loc_1.level >= _loc_3[_loc_5].level)
                {
                    _loc_4 = _loc_4 + 1;
                }
                _loc_5++;
            }
            this.mUI.rolegw.visible = false;
            if (_loc_4 > 0)
            {
                this.mUI.rolegw.visible = true;
            }
            else
            {
                _loc_6 = UserData.getOnlineData();
                if (_loc_6 && _loc_6.guanzhilingqu != 1 && _loc_1.guanzhi > 0)
                {
                    this.mUI.rolegw.visible = true;
                }
            }
            return;
        }// end function

        public function showRein(param1:Object) : void
        {
            var _loc_7:Object = null;
            var _loc_8:int = 0;
            this.mUI.rolecount.visible = false;
            var _loc_2:* = int(UserData.getUserData("level"));
            if (_loc_2 < 80)
            {
                return;
            }
            var _loc_3:* = int(UserData.getUserData("rein"));
            if (_loc_3 >= 15)
            {
                return;
            }
            var _loc_4:* = ConfigDictionary.data.rein;
            var _loc_5:int = 0;
            if (!param1)
            {
                _loc_7 = ModelProxy.getValue("zhuan", "getatt");
                if (_loc_7)
                {
                    _loc_5 = _loc_7.reinEnergy;
                }
            }
            else
            {
                _loc_5 = param1.reinEnergy;
            }
            var _loc_6:int = 0;
            if (_loc_3 < 15)
            {
                _loc_8 = _loc_3;
                while (_loc_8 <= 15)
                {
                    
                    if (_loc_5 >= _loc_4[_loc_8].needEnergy)
                    {
                        _loc_5 = _loc_5 - int(_loc_4[_loc_8].needEnergy);
                        _loc_6++;
                    }
                    _loc_8++;
                }
            }
            this.mUI.rolerein.visible = false;
            if (_loc_6 > 0)
            {
                this.mUI.rolerein.visible = true;
            }
            return;
        }// end function

        public function showWingCount() : void
        {
            var _loc_9:Array = null;
            var _loc_10:int = 0;
            var _loc_11:Array = null;
            var _loc_12:int = 0;
            var _loc_13:int = 0;
            var _loc_14:int = 0;
            var _loc_1:* = UserData.getUserData("level");
            if (_loc_1 < 60)
            {
                this.mUI.wingGanTanHao.visible = false;
                return;
            }
            var _loc_2:int = 0;
            var _loc_3:* = ConfigDictionary.data.newwinglevel;
            var _loc_4:* = ConfigDictionary.data.wing;
            var _loc_5:* = ModelProxy.getValue("data", "wing");
            var _loc_6:* = ModelProxy.getValue("data", "wing")[0].jihuonum;
            var _loc_7:* = ModelProxy.getValue("data", "wingJueXing");
            this.mUI.wingGanTanHao.visible = false;
            var _loc_8:* = ModelProxy.getValue("data", "newwing");
            if (ModelProxy.getValue("data", "newwing") == 1)
            {
                _loc_5[0].level = 1;
            }
            if (!_loc_5[0].level)
            {
                _loc_9 = (_loc_3[1].needitem as String).split("#");
                _loc_10 = ItemUilt.getAllCount(_loc_9[0]);
                if (_loc_10 > 0)
                {
                    this.mUI.wingGanTanHao.visible = true;
                }
            }
            else
            {
                if (_loc_5[0].level == 15)
                {
                    this.mUI.wingGanTanHao.visible = false;
                    return;
                }
                _loc_11 = (_loc_3[_loc_5[0].level].needitem as String).split("#");
                _loc_12 = ItemUilt.getAllCount(_loc_11[0]);
                _loc_13 = ModelProxy.getValue("data", "wingLuck");
                _loc_14 = int(_loc_3[_loc_5[0].level].luckmax) - _loc_13;
                if (_loc_12 >= _loc_14)
                {
                    this.mUI.wingGanTanHao.visible = true;
                }
            }
            return;
        }// end function

        public function showNeiGongCount(param1:Object) : void
        {
            this.mUI.roleGth.visible = false;
            this.neigongObj = param1;
            var _loc_2:* = ModelProxy.getValue("data", "neiGongCount");
            this.exp = _loc_2.exp;
            this.showNeiGong();
            return;
        }// end function

        private function showNeiGong() : void
        {
            var _loc_1:* = this.neigongObj.level;
            var _loc_2:* = ConfigDictionary.data.neili;
            if (_loc_2[_loc_1] && this.exp >= int(_loc_2[_loc_1].exp) && _loc_1 < 100)
            {
                this.mUI.roleGth.visible = true;
                ModelProxy.change("role", "showNeiGongCount", 1);
            }
            else
            {
                this.mUI.roleGth.visible = false;
                ModelProxy.change("role", "showNeiGongCount", 0);
            }
            return;
        }// end function

        public function showNeiGongAddCount(param1:int) : void
        {
            this.mUI.roleGth.visible = false;
            var _loc_2:* = ModelProxy.getValue("data", "neiGongCount");
            this.exp = _loc_2.exp;
            this.showNeiGong();
            return;
        }// end function

        public function showSkillCount(param1:int) : void
        {
            if (param1 > 0)
            {
                this.mUI.skillGanTanHao.visible = true;
            }
            else
            {
                this.mUI.skillGanTanHao.visible = false;
            }
            ModelProxy.change("skill", "setcount", null);
            return;
        }// end function

        public function showBaoShiCount() : void
        {
            var _loc_5:Object = null;
            var _loc_29:int = 0;
            var _loc_33:int = 0;
            var _loc_34:String = null;
            var _loc_35:int = 0;
            var _loc_36:Object = null;
            var _loc_37:int = 0;
            var _loc_1:* = ModelProxy.getValue("data", "BaoshiCount");
            var _loc_2:int = 0;
            var _loc_3:Array = [];
            var _loc_4:Array = [];
            for each (_loc_5 in _loc_1)
            {
                
                if (_loc_5.itemidList)
                {
                    _loc_4 = _loc_5.itemidList;
                }
                else
                {
                    _loc_4 = _loc_5 as Array;
                }
                if (_loc_4)
                {
                    _loc_33 = 0;
                    while (_loc_33 < _loc_4.length)
                    {
                        
                        if (_loc_4[_loc_33] == 0)
                        {
                            _loc_2 = _loc_2 + 1;
                        }
                        else
                        {
                            _loc_3.push(_loc_4[_loc_33]);
                        }
                        _loc_33++;
                    }
                }
            }
            if (_loc_2 == 0)
            {
                this.mUI.roleGth2.visible = false;
                return;
            }
            var _loc_6:Array = [];
            var _loc_7:Array = [];
            var _loc_8:Array = [];
            var _loc_9:Array = [];
            var _loc_10:Array = [];
            var _loc_11:Array = [];
            var _loc_12:Array = [];
            var _loc_13:Array = [];
            var _loc_14:int = 0;
            while (_loc_14 < _loc_3.length)
            {
                
                _loc_34 = String(_loc_3[_loc_14]).substr(7, 2);
                _loc_35 = int(_loc_34);
                if (_loc_35 <= 10)
                {
                    _loc_6.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 10 && _loc_35 <= 20)
                {
                    _loc_7.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 20 && _loc_35 <= 30)
                {
                    _loc_8.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 30 && _loc_35 <= 40)
                {
                    _loc_9.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 40 && _loc_35 <= 50)
                {
                    _loc_10.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 50 && _loc_35 <= 60)
                {
                    _loc_11.push(_loc_3[_loc_14]);
                }
                else if (_loc_35 > 60 && _loc_35 <= 70)
                {
                    _loc_12.push(_loc_3[_loc_14]);
                }
                else
                {
                    _loc_13.push(_loc_3[_loc_14]);
                }
                _loc_14++;
            }
            var _loc_15:* = UserData.getUserData("career");
            var _loc_16:* = UserData.getBagData();
            var _loc_17:* = UserData.getBagData().maxcount;
            var _loc_18:int = 0;
            var _loc_19:int = 0;
            var _loc_20:int = 0;
            var _loc_21:int = 0;
            var _loc_22:int = 0;
            var _loc_23:int = 0;
            var _loc_24:int = 0;
            var _loc_25:int = 0;
            var _loc_26:int = 1;
            while (_loc_26 < _loc_17)
            {
                
                _loc_36 = _loc_16[_loc_26];
                if (_loc_36)
                {
                    if (_loc_36[4] && int(_loc_36[4].itemtype) == 2 && int(_loc_36[4].cls) == 14)
                    {
                        _loc_37 = int((_loc_36[4].itemid as String).substr(7, 2));
                        if (_loc_37 <= 10)
                        {
                            if (_loc_15 == 1)
                            {
                                _loc_18 = _loc_18 + ItemUilt.getAllCount(_loc_36[4].itemid);
                            }
                        }
                        else if (_loc_37 > 10 && _loc_37 <= 20)
                        {
                            if (_loc_15 == 2)
                            {
                                _loc_19 = _loc_19 + ItemUilt.getAllCount(_loc_36[4].itemid);
                            }
                        }
                        else if (_loc_37 > 20 && _loc_37 <= 30)
                        {
                            if (_loc_15 == 3)
                            {
                                _loc_20 = _loc_20 + ItemUilt.getAllCount(_loc_36[4].itemid);
                            }
                        }
                        else if (_loc_37 > 30 && _loc_37 <= 40)
                        {
                            _loc_21 = _loc_21 + ItemUilt.getAllCount(_loc_36[4].itemid);
                        }
                        else if (_loc_37 > 40 && _loc_37 <= 50)
                        {
                            _loc_22 = _loc_22 + ItemUilt.getAllCount(_loc_36[4].itemid);
                        }
                        else if (_loc_37 > 50 && _loc_37 <= 60)
                        {
                            _loc_23 = _loc_23 + ItemUilt.getAllCount(_loc_36[4].itemid);
                        }
                        else if (_loc_37 > 60 && _loc_37 <= 70)
                        {
                            _loc_24 = _loc_24 + ItemUilt.getAllCount(_loc_36[4].itemid);
                        }
                        else
                        {
                            _loc_25 = _loc_25 + ItemUilt.getAllCount(_loc_36[4].itemid);
                        }
                    }
                }
                _loc_26++;
            }
            var _loc_27:Array = [];
            var _loc_28:int = 0;
            if (_loc_18 > 0 && _loc_6.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_6.length;
                if (_loc_18 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_18;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_19 > 0 && _loc_7.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_7.length;
                if (_loc_19 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_19;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_20 > 0 && _loc_8.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_8.length;
                if (_loc_20 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_20;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_21 > 0 && _loc_9.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_9.length;
                if (_loc_21 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_21;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_22 > 0 && _loc_10.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_10.length;
                if (_loc_22 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_22;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_23 > 0 && _loc_11.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_11.length;
                if (_loc_23 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_23;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_24 > 0 && _loc_12.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_12.length;
                if (_loc_24 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_24;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            if (_loc_25 > 0 && _loc_13.length < (_loc_1 as Array).length)
            {
                _loc_29 = (_loc_1 as Array).length - _loc_13.length;
                if (_loc_25 <= _loc_29)
                {
                    _loc_28 = _loc_28 + _loc_25;
                }
                else
                {
                    _loc_28 = _loc_28 + _loc_29;
                }
            }
            var _loc_30:* = UserData.getUserData("level");
            var _loc_31:* = ConfigDictionary.data.openlevel;
            var _loc_32:* = ConfigDictionary.data.openlevel["role"][4].level;
            if (_loc_30 >= _loc_32 && _loc_28 > 0 && _loc_2 > 0)
            {
                this.mUI.roleGth2.visible = true;
            }
            else
            {
                this.mUI.roleGth2.visible = false;
            }
            return;
        }// end function

        public function playVip() : void
        {
            if (this.vipmc == null)
            {
                XMLMcManager.instance.MainuiMc("viplight", this.viploadComp);
            }
            return;
        }// end function

        private function viploadComp(param1:XMLMovieClip) : void
        {
            this.vipmc = param1;
            if (this.vipmc)
            {
                this.vipmc.x = this.mUI.vip.x - 13;
                this.vipmc.y = this.mUI.vip.y - 15;
                this.vipmc.interval = 120;
                this.vipmc.blendMode = BlendMode.ADD;
                this.vipmc.mouseEnabled = false;
                this.vipmc.mouseChildren = false;
                this.vipmc.interval = 1000 / 12;
                this.vipmc.play();
                this.mUI.addChild(this.vipmc);
            }
            return;
        }// end function

        public function stopVip() : void
        {
            if (this.vipmc)
            {
                this.vipmc.dispose();
                this.mUI.removeChild(this.vipmc);
                this.vipmc = null;
            }
            return;
        }// end function

        public function shenlujiaoniaoCT() : void
        {
            var _loc_1:* = UserData.getOnlineData();
            this.Message = _loc_1.armhc;
            var _loc_2:* = UserData.getUserData("level");
            this.yycountArr = [];
            this.mUI.shenlucountbox.visible = false;
            this.yycountArr.push({bagcount:UserData.getBagData("atkchip"), _type:3});
            this.yycountArr.push({bagcount:UserData.getBagData("defchip"), _type:2});
            this.yycountArr.push({bagcount:UserData.getBagData("hpchip"), _type:1});
            this.yycountArr.push({bagcount:UserData.getBagData("crichip"), _type:4});
            var _loc_3:int = 0;
            var _loc_4:Array = [];
            var _loc_5:int = 0;
            while (_loc_5 < this.yycountArr.length)
            {
                
                this.lv = this.Message[this.yycountArr[_loc_5]._type];
                _loc_4 = this.Messagedata(this.yycountArr[_loc_5]._type);
                if (this.yycountArr[_loc_5].bagcount >= _loc_4[0] && _loc_2 >= _loc_4[1])
                {
                    if (this.lv < this.max)
                    {
                        _loc_3 = _loc_3 + 1;
                    }
                }
                _loc_5++;
            }
            if (_loc_3)
            {
                this.mUI.shenlucountbox.visible = true;
            }
            return;
        }// end function

        private function Messagedata(param1:int) : Array
        {
            var _loc_2:int = 0;
            var _loc_3:int = 0;
            var _loc_4:Object = null;
            var _loc_5:int = 0;
            var _loc_6:Object = null;
            for each (_loc_4 in this._shenlugonfig)
            {
                
                if (param1 == _loc_4.type)
                {
                    this.max = _loc_4.lv;
                }
            }
            for each (_loc_6 in this._shenlugonfig)
            {
                
                _loc_5 = _loc_5 + 1;
                if (this.lv == 0)
                {
                    if (param1 == _loc_6.type)
                    {
                        _loc_2 = _loc_6.count;
                        _loc_3 = _loc_6.uselv;
                        break;
                    }
                    continue;
                }
                if (param1 == _loc_6.type && this.lv == _loc_6.lv)
                {
                    if (this.lv == this.max)
                    {
                        _loc_2 = _loc_6.xuyaoCL_count;
                        _loc_3 = _loc_6.uselv;
                        break;
                        continue;
                    }
                    _loc_2 = this._shenlugonfig[_loc_5].xuyaoCL_count;
                    _loc_3 = this._shenlugonfig[_loc_5].uselv;
                    break;
                }
            }
            return [_loc_2, _loc_3];
        }// end function

    }
}
